%li{ id: dom_id(runner) }
  .gl-display-flex.gl-justify-content-space-between
    %div
      = runner_status_icon(runner, size: 16)
      - if @project_runners.include?(runner)
        = link_to "##{runner.id} (#{runner.short_sha})", project_runner_path(@project, runner)
      - else
        %span
          = "##{runner.id} (#{runner.short_sha})"
      - if runner.locked? && runner.project_type?
        %span.has-tooltip{ title: s_('Runners|Runner is locked and available for currently assigned projects only. Only administrators can change the assigned projects.') }
          = sprite_icon('lock')
    .gl-ml-2
      .btn-group.btn-group-sm
        - if @project_runners.include?(runner)
          = link_button_to nil, edit_project_runner_path(@project, runner), title: _('Edit'), aria: { label: _('Edit') }, data: { testid: 'edit-runner-link', toggle: 'tooltip', placement: 'top', container: 'body' }, icon: 'pencil'
          - if runner.active?
            = link_button_to nil, pause_project_runner_path(@project, runner), method: :post, title: s_('Runners|Pause from accepting jobs'), aria: { label: _('Pause') }, data: { toggle: 'tooltip', container: 'body', confirm: _("Are you sure?") }, icon: 'pause'
          - else
            = link_button_to nil, resume_project_runner_path(@project, runner), method: :post, title: s_('Runners|Resume accepting jobs'), aria: { label: _('Resume') }, data: { toggle: 'tooltip', container: 'body' }, icon: 'play'
          - if runner.belongs_to_one_project?
            = link_button_to _('Remove runner'), project_runner_path(@project, runner), aria: { label: _('Remove') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, variant: :danger
          - else
            - runner_project = @project.runner_projects.find_by(runner_id: runner) # rubocop: disable CodeReuse/ActiveRecord
            = link_button_to _('Disable for this project'), project_runner_project_path(@project, runner_project), aria: { label: _('Disable') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, variant: :danger
        - elsif runner.project_type?
          = form_for [@project, @project.runner_projects.new] do |f|
            = f.hidden_field :runner_id, value: runner.id
            = f.submit _('Enable for this project'), class: 'btn gl-button'
  - if runner.description.present?
    %p.gl-my-2
      = runner.description
  - if runner.tags.present?
    .gl-my-2
      - runner.tags.map(&:name).sort.each do |tag|
        = gl_badge_tag tag, variant: :info, size: :sm
